﻿using Abp.Domain.Entities.Auditing;
using SingleUserMall.Authorization.Users;
using SingleUserMall.Items;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Orders
{
    public class GroupOrder : FullAuditedEntity<long>
    {
        public virtual ICollection<GroupOrderDetail> GroupOrderDetails { get; set; }
        /// <summary>
        /// 用户id
        /// </summary>
        public long UserId { get; set; }
        [ForeignKey("UserId")]
        public virtual User User { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        public long ItemId { get; set; }
        [ForeignKey("ItemId")]
        public virtual Item Item { get; set; }
        /// <summary>
        /// 商品规格id
        /// </summary>
        public long ItemSpecId { get; set; }
        [ForeignKey("ItemSpecId")]
        public virtual ItemSpec ItemSpec { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Qty { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime BeginTime { get; set; }
        /// <summary>
        /// 截止时间
        /// </summary>
        public DateTime EndTime { get; set; }
        /// <summary>
        /// 拼单数量
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 参团数量
        /// </summary>
        public int PartinCount { get; set; }
        /// <summary>
        /// 团购状态（-1：撤销，0：初始化，1：组团中，2：成功）
        /// </summary>
        public GroupOrderStatus Status { get; set; }
    }
}
